﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.ComponentModel;
using Sirenix.OdinInspector;
namespace Data
{
    [Serializable]
    public class EventRange : EventData
    {
        [ShowInInspector,LabelText("名称")]
        private String RangeName = String.Empty;
        public const String CATEGORY_HITEDJUDGE = "范围检测";
        
        public UInt16 FrameType_Int { get { return (UInt16)mFramType; } set { mFramType = (HitDefnitionFramType)value; } }
        
        private HitDefnitionFramType mFramType = HitDefnitionFramType.CuboidType;
        [ShowInInspector, LabelText("技能击中框的类型")]
        [DisplayName("技能击中框的类型"), Description("技能击中框的类型:CuboidType为长方体;CylinderType为立方体; RingType:为圆环形; SomatoType:为受击体"), DefaultValue(HitDefnitionFramType.CuboidType), Category(CATEGORY_HITEDJUDGE)]
        public HitDefnitionFramType FramType
        {
            get { return mFramType; }
            set
            {
                mFramType = value;
                switch (value)
                {
                    case HitDefnitionFramType.CuboidType:
                        mAttackType = new FrameCuboid();
                        break;
                    case HitDefnitionFramType.CylinderType:
                        mAttackType = new FrameCylinder();
                        break;
                    case HitDefnitionFramType.RingType:
                        mAttackType = new FrameRing();
                        break;
                    case HitDefnitionFramType.SomatoType:
                        mAttackType = new FrameSomato();
                        break;
                    case HitDefnitionFramType.FanType:
                        mAttackType = new FrameFan();
                        break;
                }
            }
        }
        
        AttackFrame mAttackType = new FrameCuboid();
        [ShowInInspector,LabelText("技能击中框")]
        [DisplayName("技能击中框"),Description("技能击中框"), Category(CATEGORY_HITEDJUDGE)]
        public AttackFrame AttackType { get { return mAttackType; } set { mAttackType = value; } }

        EUnitCamp mRace = EUnitCamp.EUC_ENEMY;
        [ShowInInspector, LabelText("阵营")]
        [DisplayName("阵营"), Description("敌方,友方"), Category(CATEGORY_HITEDJUDGE), DefaultValue(EUnitCamp.EUC_ENEMY)]
        public EUnitCamp Race { get { return mRace; } set { mRace = value; } }
       
        String mBuffID = String.Empty;
        [ShowInInspector, LabelText("追加Buff的ID号")]
        [DisplayName("BuffID"), DefaultValue(""), Description("追加Buff的ID号"), Category(CATEGORY_HITEDJUDGE)]
        public String BuffID { get { return mBuffID; } set { mBuffID = value; } }

        public override EventType Type()
        {
            return EventType.RangeAction;
        }

        public override string EventContent()
        {
            return RangeName;
        }
    }
}
